<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>用户列表</title>
    <link rel="stylesheet" href="./css/common.css" />
  </head>
  <body>
    <h1>用户列表</h1>
    <input type="button" value="增加用户" onclick="addUser()" />
    <table>
      <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>操作</th>
      </tr>
      {%for user in users%}
      <tr>
        <td>{{user.id}}</td>
        <td>{{user.name}}</td>
        <td>{{user.age}}</td>
        <td>
          <input type="button" value="编辑" onclick="edit('{{user.id}}')" />
          <input type="button" value="删除" onclick="del('{{user.id}}')" />
        </td>
      </tr>
      {% endfor %}
    </table>
    <span>{{user}}</span>

    <script src="./js/user.js"></script>
  </body>
</html>
